package com.ting.etp.main.controller;

import com.ting.common.vo.Result;
import com.ting.etp.main.service.TestTableOneService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/main")
@Slf4j
public class MainController {

    @Autowired
    TestTableOneService testTableOneService;

    @GetMapping("/test")
    public Result<String> test(@RequestParam(defaultValue = "hello",name = "name")String name){
        testTableOneService.saveOne(name);
        log.info("请求成功{}",name);
        return Result.success(name);
    }
}
